<?php
/**
 * @copyright	Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
 * @license		GNU/GPL, see LICENSE.php
 * Joomla! is free software. This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 * See COPYRIGHT.php for copyright notices and details.
 */
defined('_JEXEC') or die('Restricted access');
require_once('vars.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" >
<head>
	


<!-- Default stylesheets -->
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/system.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/general.css" type="text/css" />


<!-- Template specific stylesheets -->
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/reset.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/template.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/styles/<?php echo $colorStyle; ?>.css" type="text/css" />



<!--[if IE 7 ]>
	<style>.searchbar input.button{padding-left:9999px;.clearfix{height:0}</style>
<![endif]-->

<!--[if lte IE 6 ]>
	<link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template ?>/css/ie.css" type="text/css" />
<![endif]-->

<jdoc:include type="head" />

<!-- load mootools -->

<?php JHTML::_('behavior.mootools'); ?>


<?php if ($menuAnimation && $this->countModules('menu')): ?>
<!-- Menu animation javascript -->
<script type="text/javascript" src="<?php echo $this->baseurl;?>/templates/<?php echo $this->template;?>/js/menufx.js"></script>
<?php endif; ?>


<?php if ($accordionModule && $this->countModules('accordion')): ?>
<!-- Accordion Modules -->
<script type="text/javascript" charset="utf-8">
window.addEvent('domready', function() {
	//create Accordion instance
	var myAccordion = new Accordion($('accordion-modules'), 'h3.toggler', 'div.toggle_area', {
		opacity: true,
		onActive: function(toggler, element){
			toggler.setStyle('color', '#FFFFFF');
		},
		onBackground: function(toggler, element){
			toggler.setStyle('color', '#999999');
		}
	});
});
</script>
<?php endif; ?>
</head>

<body class="<?php echo $bodyClass; ?>">
	<div class="wrapper">
		<div class="primary">
			<div class="columns">
				<div class="main">	
					<!-- Header start -->
					<div id="header">
						<div class="branding">
							<h1 id="logo" title="<?php echo $conf->getValue('config.sitename'); ?>">
								<a href="<?php echo $this->baseurl ?>" title="<?php echo $conf->getValue('config.sitename'); ?>"><span></span><?php echo $conf->getValue('config.sitename'); ?></a>
							</h1>							
						</div><!-- .branding -->
					</div>
					<!-- Header end -->

					<!-- Content area start -->
					<div id="content" class="<?php echo $pathwayEnabled; ?>">
						<?php if($this->countModules('user1')) : ?>
	    	  				<div class="top_modules">
								<jdoc:include type="modules" name="user1" style="tr_flexwidth" grid_width="<?php echo $this->countModules('user1') ?>" />
							</div>
							<div class="clearfix"></div>
						<?php endif; ?>
						<?php if ($menu->getActive() != $menu->getDefault()) : ?>
							<p class="pathway"><jdoc:include type="module" name="breadcrumbs" /></p>
						<?php endif; ?>
						<?php if ($this->getBuffer('message')) : ?>
							<div class="error">
								<h2><?php echo JText::_('System Message'); ?></h2>
								<jdoc:include type="message" />
							</div>
						<?php endif; ?>
						<jdoc:include type="component" />
							<?php if($this->countModules('user2')) : ?>
	    	  				<div class="bottom_modules">
								<jdoc:include type="modules" name="user2" style="tr_flexwidth" grid_width="<?php echo $this->countModules('user2') ?>" />
							</div>
							<div class="clearfix"></div>
						<?php endif; ?>

					</div>
					<!-- Content area end -->
				</div> <!-- end main -->
			</div> <!-- end columns -->

			<!-- sidebar start -->
			<div id="sidebar">
				<div class="searchbar">
				<?php if($this->countModules('user4')) : ?>
						<jdoc:include type="modules" name="user4" style="raw" />
				<?php endif; ?>
				</div>
				<?php if($this->countModules('menu')) : ?>
	      			<div id="mainmenu">
						<jdoc:include type="modules" name="menu" style="menu" />
					</div>
				<?php endif; ?>

				<?php if($this->countModules('left')) : ?>
	      			<div id="left-modules">
	      				<jdoc:include type="modules" name="left" style="semi_rounded" />
	      			</div><!-- #left-modules -->
				<?php endif; ?>		
						
				<?php if ($accordionModule && $this->countModules('accordion')): ?>
	      			<div id="accordion-modules">
	      				<jdoc:include type="modules" name="accordion" style="semi_rounded_accordion" />
	      			</div><!-- #accordion -->
				<?php endif; ?>

				<?php if($this->countModules('bottom')) : ?>
	      			<div id="sidebar-bottom">
	      				<jdoc:include type="modules" name="bottom" style="semi_rounded" />
	      			</div><!-- #sidebar-bottom -->
				<?php endif; ?>

			</div>
			<!-- sidebar end -->
		</div> <!-- end primary -->
		<div id="footer">
			<?php echo $copyrightText; ?>
		</div>
	</div> <!-- end wrapper -->

<?php if($this->countModules('debug')) { ?>
	<div id="debug">
		<jdoc:include type="modules" name="debug" />
	</div>
<?php } ?>

</body>
</html>